<template>
		<view>
		<web-view :src="datas.data"></web-view>
	</view>
<!-- 	<view class="content">
		<text>banner广告</text>
		<ad adpid="1951764750"></ad>
		<text>视频广告</text>
		<ad-fullscreen-video adpid="1113100813"></ad-fullscreen-video>
		<text>激励视频广告</text>
		<ad-rewarded-video adpid="1320436948" :loadnext="true" v-slot:default="{loading, error}" @load="onadload"
			@close="onadclose" @error="onaderror">
			<button :disabled="loading" :loading="loading">显示广告</button>
			<view v-if="error">{{error}}</view>
		</ad-rewarded-video>
		<text>插屏广告</text>
		<ad-interstitial adpid="1257720114" :loadnext="true" v-slot:default="{loading, error}" @load="onadload"
			@close="onadclose" @error="onaderror">
			<button :disabled="loading2" :loading="loading2">显示广告</button>
			<view v-if="error">{{error}}</view>
		</ad-interstitial>
	</view> -->
</template>

<script setup>
	import {
		onMounted,
		ref,
		reactive
	} from 'vue';
	import config from '../../common/config';
	let loading = ref(false)
	let loading2 = ref(false)

	let datas = ref({
		data: ""
	})
	const giteeUrl = ref(config.giteeUrl);
	onMounted(() => {
		// 从码云读取数据
		console.log(giteeUrl.value + "article.dat")
		uni.request({
			url: giteeUrl.value + "article.dat",
			success: (res) => {
				datas.value.data = res.data.data;
			}
		})
	})

	// function onadload(e) {
	// 	console.log('广告数据加载成功');
	// }

	// function onadclose(e) {
	// 	const detail = e.detail
	// 	// 用户点击了【关闭广告】按钮
	// 	if (detail && detail.isEnded) {
	// 		// 正常播放结束
	// 		console.log("onadclose " + detail.isEnded);
	// 	} else {
	// 		// 播放中途退出
	// 		console.log("onadclose " + detail.isEnded);
	// 	}
	// }

	// function onaderror(e) {
	// 	// 广告加载失败
	// 	console.log("onaderror: ", e.detail);
	// }
</script>

<style>

</style>